#!/usr/bin/python
import subprocess

class Ping(object):
    def __init__(self, hosts):
        for host in hosts:
            res = subprocess.call(['ping', '-c', '3', host])
            if res == 0:
                print "\n"
                print "*****************ping to******************", host, "OK"
                print "\n"
            elif res == 2:
                print "\n"
                print "*****************no response from*********", host
                print "\n"
            else:
                print "\n"
                print "*****ping to", host, "failed!**************"
                print "\n"

if __name__ == '__main__':
    hosts = [ '192.168.0.2', 
              '192.168.0.3',
              '192.168.0.4',
              '192.168.0.14'
              ]
    Ping(hosts)
        
